//
//  ViewController.m
//  IkongWuProgram
//
//  Created by 徐益智 on 16/2/16.
//  Copyright © 2016年 Vdianjing. All rights reserved.
//

#import "UITextField+textField.h"
@implementation UITextField (textField)

+ (UITextField *)textFieldWithFont:(CGFloat)font
                      withTextColor:(UIColor *)textColor
                withBackgroundColor:(UIColor *)backgroundColor
                   withKeyBoardType:(UIKeyboardType)keyboardType
                  withEextAlignment:(NSTextAlignment)textAlignment
                withClearButtonMode:(UITextFieldViewMode)clearButtonMode
                           withText:(NSString *)text
                    withPlaceholder:(NSString *)placeholder
           withPlaceholderTextColor:(UIColor *)placeholderTextColor
{
    UITextField *textField = [[UITextField alloc] init];
    
    textField.font = [UIFont systemFontOfSize:font];
    textField.keyboardType = keyboardType;
    textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholder attributes:@{NSForegroundColorAttributeName:placeholderTextColor}];
    textField.backgroundColor = backgroundColor;
    textField.textColor = textColor;
    textField.text = text;
    textField.textAlignment = textAlignment;
    textField.clearButtonMode = clearButtonMode;
    
    return textField;
}


@end
